<?php if (!defined('THINK_PATH')) exit();?><!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
        <title></title>

<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/part.css" />
<script type="text/javascript" src="__PUBLIC__/Admin/js/css3.js"></script>
</head>
<script>
    var url ="__URL__";
    var  APP= "__APP__";
    var ROOT = "__ROOT__";
    $(function(){
        //点击删除
        $('.delpart').live('click',function(){
            if(!window.confirm('确定删除？')){
                return false;
            }
            var id = $(this).attr('name');
            var _this = $(this);
            $.get(url+'/delPart&id='+id,function(data){
                if(data.num==1){
                    _this.parent().parent().remove();
                    alert(data.error);
                }else{
                    alert(data.error);   
                }
            },'json')
        })
    })
</script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/part.js"></script>
    <body>
        <div class="top_addres">

            <div class="addres">商品分类</div>
            <span class="middle_bottom">|</span>
            <a class="addsection" href="<?php echo U('addClass');?>"><span class="gtubiao"></span>添加分类</a> 
        </div>
        <input type="hidden" value="0" name="path">
        <table class="table1" cellspacing="0">
            <tr>
                <th style="width:60px">ID</th>
                <th>栏目名</th>
                <th style="width:100px">所属栏目</th>
                <th>子栏目数</th>
                <th style="width:300px">操作</th>
            </tr>
            <?php if(is_array($classData)): foreach($classData as $key=>$n): ?><tr>
                <td><span class="whoid"><?php echo ($n["cid"]); ?></span></td>
                <td class="partname"><a href="javascript:;" pid="<?php echo ($n["cid"]); ?>" num='2' class="tjia"><span  class="jia xiala"></span><?php echo ($n["classname"]); ?></a></td>
                <td width="150"><span class="whopart">顶级栏目</span></td>
                <td width="100"><?php echo ($n["partnum"]); ?></td>
                <td>&nbsp;<a href='javascript:;' name="<?php echo ($n["id"]); ?>" class='delpart'>删除</a> |
                    <a href="__ROOT__/index.php?c=Index&m=part&id=<?php echo ($n["id"]); ?>" target='_blank'>预览</a> |
                    <a href="<?php echo U('addClass',array('cid'=>$n['cid']));?>" class='childpart'>添加子栏目</a>  
                    | <a href="__CONTROL__/gedit&id=<?php echo ($n["id"]); ?>">修改</a>
                </td>
            </tr><?php endforeach; endif; ?>
            <!--请求数据时-->
            <div class="beforeajax"></div>
        </table>
    </body>
</html>